﻿<UserControl x:Class="Microsoft.Research.Provenance.Controls.View.WorkflowSummaryView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
    Height="Auto" Width="Auto" AutomationProperties.Name="AIDWorkFlowSummaryView">
    <UserControl.Resources>
        <ResourceDictionary Source="../ProvenanceControlResources.xaml"></ResourceDictionary>
    </UserControl.Resources>
    <Expander Expanded="OnExpanded" Header="Job Details" Style="{DynamicResource ExpanderStyle2}" FontSize="12" Margin="10,10,10,10" IsExpanded="{Binding Path=IsExpanded}"  AutomationProperties.Name="ANameSummaryExpander">
        <Border BorderBrush="#FFC8C8C8" BorderThickness="1,0,1,1" CornerRadius="0,0,5,5">
            <Border VerticalAlignment="Top" Margin="5,5,5,5" BorderThickness="1,1,1,1" CornerRadius="5,5,5,5" BorderBrush="#FFC8C8C8">
            <Grid>
        <ListView HorizontalAlignment="Stretch"  VerticalAlignment="Stretch" IsSynchronizedWithCurrentItem="True" 
                  ItemsSource="{Binding Path=SummaryModelCollection}" AutomationProperties.Name="ANameSummaryListView">
            <ListView.View>
                <GridView>
                    <GridViewColumn Width="Auto" DisplayMemberBinding="{Binding Path=Name}">
                        <GridViewColumnHeader >
                            <TextBlock Text="Workflow Name" HorizontalAlignment="Left" FontWeight="Bold"/>
                        </GridViewColumnHeader>
                        <GridViewColumn.CellTemplate>
                            <DataTemplate>
                                <TextBlock Text="{Binding Path=Name}" ToolTip="{Binding Path=Name}" TextTrimming="CharacterEllipsis" AutomationProperties.Name="ANameWFName" />
                            </DataTemplate>
                        </GridViewColumn.CellTemplate>
                    </GridViewColumn>
                    <GridViewColumn DisplayMemberBinding="{Binding Path=AuthoredBy}">
                        <GridViewColumnHeader>
                            <TextBlock Text="Author" HorizontalAlignment="Left" FontWeight="Bold"/>
                        </GridViewColumnHeader>
                        <GridViewColumn.CellTemplate>
                            <DataTemplate>
                                <TextBlock Text="{Binding Path=AuthoredBy}" ToolTip="{Binding Path=AuthoredBy}" TextTrimming="CharacterEllipsis" AutomationProperties.Name="ANameAuthoredBY"/>
                            </DataTemplate>
                        </GridViewColumn.CellTemplate>
                    </GridViewColumn>
                    
                   <GridViewColumn DisplayMemberBinding="{Binding Path=Version}">
                        <GridViewColumnHeader>
                            <TextBlock Text="Workflow Version" HorizontalAlignment="Left" FontWeight="Bold"/>
                        </GridViewColumnHeader>
                        <GridViewColumn.CellTemplate>
                            <DataTemplate>
                                <TextBlock Text="{Binding Path=Version}" ToolTip="{Binding Path=Version}" HorizontalAlignment="Center"
                                           TextTrimming="CharacterEllipsis" AutomationProperties.Name="ANameVersion"/>
                            </DataTemplate>
                        </GridViewColumn.CellTemplate>
                    </GridViewColumn>
                    
                    <GridViewColumn  Width="Auto" DisplayMemberBinding="{Binding Path=JobName}">
                        <GridViewColumnHeader>
                            <TextBlock Text="Job Name" HorizontalAlignment="Left" FontWeight="Bold"/>
                        </GridViewColumnHeader>
                        <GridViewColumn.CellTemplate>
                            <DataTemplate>
                                <TextBlock Text="{Binding Path=JobName}" ToolTip="{Binding Path=JobName}" TextTrimming="CharacterEllipsis" AutomationProperties.Name="ANameJobName"/>
                            </DataTemplate>
                        </GridViewColumn.CellTemplate>
                    </GridViewColumn>
                    <GridViewColumn Width="Auto" DisplayMemberBinding="{Binding Path=ScheduledBy}">
                        <GridViewColumnHeader>
                            <TextBlock Text="Scheduled By" HorizontalAlignment="Left" FontWeight="Bold"/>
                        </GridViewColumnHeader>
                        <GridViewColumn.CellTemplate>
                            <DataTemplate>
                                <TextBlock Text="{Binding Path=ScheduledBy}" ToolTip="{Binding Path=ScheduledBy}" TextTrimming="CharacterEllipsis" MinWidth="100" AutomationProperties.Name="ANameScheduledBy"/>
                            </DataTemplate>
                        </GridViewColumn.CellTemplate>
                    </GridViewColumn>

                    <GridViewColumn  Width="Auto" DisplayMemberBinding="{Binding Path=Node}">
                        <GridViewColumnHeader>
                            <TextBlock Text="Node" HorizontalAlignment="Left" FontWeight="Bold"/>
                        </GridViewColumnHeader>
                        <GridViewColumn.CellTemplate>
                            <DataTemplate>
                                <TextBlock Text="{Binding Path=Node}" ToolTip="{Binding Path=Node}" TextTrimming="CharacterEllipsis" MinWidth="100" AutomationProperties.Name="ANameNode"/>
                            </DataTemplate>
                        </GridViewColumn.CellTemplate>
                    </GridViewColumn>

                    <GridViewColumn  Width="Auto" DisplayMemberBinding="{Binding Path=StartDateTime}">
                        <GridViewColumnHeader>
                            <TextBlock Text="Date Started" HorizontalAlignment="Left" FontWeight="Bold"/>
                        </GridViewColumnHeader>
                        <GridViewColumn.CellTemplate>
                            <DataTemplate>
                                <TextBlock Text="{Binding Path=StartDateTime}" ToolTip="{Binding Path=StartDateTime}" TextTrimming="CharacterEllipsis" MinWidth="100" AutomationProperties.Name="ANameStartDateTime"/>
                            </DataTemplate>
                        </GridViewColumn.CellTemplate>
                    </GridViewColumn>

                    <GridViewColumn  Width="Auto" DisplayMemberBinding="{Binding Path=Duration}">
                        <GridViewColumnHeader>
                            <TextBlock Text="Duration" HorizontalAlignment="Left" FontWeight="Bold"/>
                        </GridViewColumnHeader>
                        <GridViewColumn.CellTemplate>
                            <DataTemplate>
                                <TextBlock Text="{Binding Path=Duration}" ToolTip="{Binding Path=Duration}" TextTrimming="CharacterEllipsis"  MinWidth="100" AutomationProperties.Name="ANameDuration"/>
                            </DataTemplate>
                        </GridViewColumn.CellTemplate>
                    </GridViewColumn>
                </GridView>
            </ListView.View>
        </ListView>
    </Grid>
        </Border>
        </Border>
    </Expander>

</UserControl>
